package com.xwdeshj.controller;

import com.alibaba.fastjson.JSONObject;
import com.xwdeshj.service.XwScenicAtlasinfoService;
import com.xwdeshj.utils.IMoocExceptionHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by BKWJA on 2019/1/7.
 * 景区图集信息
 */
@Slf4j
@RequestMapping("sceAtlasinfo")
@CrossOrigin(allowCredentials = "true")
@Controller
public class XwScenicAtlasinfoController extends IMoocExceptionHandler {

    @Autowired
    private XwScenicAtlasinfoService xwScenicAtlasinfoService;

    /**
     * 景区——新增图集
     * @param parmJson  scenic_encryptId:景区加密id，imglink：图片链接url
     * @return
     */
    @RequestMapping("savescenicImgurl")
    @ResponseBody
    public JSONObject savescenicImgurl(String parmJson, HttpServletRequest request){
        return xwScenicAtlasinfoService.savescenicImgurl(parmJson,request);
    }

    /**
     *  弹框中获取对应店铺下的 图片图集  景区
     * @param scenic_encryptId
     * @param request
     * @return
     */
    @RequestMapping("getscenicaltlasinfowin")
    @ResponseBody
    public JSONObject getscenicaltlasinfowin(String scenic_encryptId,HttpServletRequest request){
        return xwScenicAtlasinfoService.getscenicaltlasinfowin(scenic_encryptId,request);
    }


}
